A=[[],[],[],[],[],[],[],[],[],[]]
B=[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
import random
for i in range(10):
    for j in range(20):
        A[i].append(random.randint(140,200))
def theshortone(n):
    p=n[0]
    for k in range(len(n)):
        q=n[k]
        if q<p:
            p=n[k]
    return p
def thetallone(n):
    p=n[0]
    for k in range(len(n)):
        q=n[k]
        if q>p:
            p=n[k]
    return p
T=[]
S=[]
for i in range(20):
    for j in range(10):
        B[i].append(A[j][i])
for i in range(10):
    S.append(theshortone(A[i]))
for i in range(20):
    T.append(thetallone(B[i]))
if theshortone(T)>thetallone(S):
    print 1
else:
    print 0
